﻿using DotNetCommon;
using System;
using System.Collections.Generic;
using System.Text;

namespace DBUtil
{
    /// <summary>
    /// 批量插入项
    /// </summary>
    public class InsertBatchItem
    {
        private InsertBatchItem() { }
        /// <summary>
        /// 表名
        /// </summary>
        public string TableName { get; set; }
        /// <summary>
        /// 插入项字典
        /// </summary>
        public IDictionary<string, object> Dic { get; set; }
        /// <summary>
        /// 创建插入项
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="dic"></param>
        /// <returns></returns>
        public static InsertBatchItem Create(string tableName, IDictionary<string, object> dic)
        {
            Ensure.NotNullOrEmptyOrWhiteSpace(tableName);
            Ensure.NotNullOrEmpty(dic);
            return new InsertBatchItem()
            {
                TableName = tableName,
                Dic = dic
            };
        }
    }
}
